package rsj.service.test;

import org.springframework.stereotype.Component;
import rsj.api.test.entity.AddTestDataParam;
import rsj.db.dbutils.UniqueID;

/**
 * 供应商数据录入
 *
 * @author yuanqinglong
 * @since 2021/3/15 13:47
 */
@Component
public class AddSupplierData implements IAddDataTemplateMethod {


    /**
     * 添加语句SQL
     *
     * @param addTestDataParam 参数
     * @return SQL
     */
    @Override
    public String generateAdditionStatement(AddTestDataParam addTestDataParam) {
        String sql = " INSERT INTO sys.sys_test_log (log_id, log_org_name, log_prod_name, log_amount, log_time, log_type)" +
                " VALUES ";
        String values = "(" +
                "'" + UniqueID.generateId() + "'" + "," +
                "'" + addTestDataParam.getLogOrgName() + "'" + "," +
                "'" + addTestDataParam.getLogProdName() + "'" + "," +
                "'" + addTestDataParam.getLogAmount() + "'" + "," +
                "'" + addTestDataParam.getLogTime() + "'" + "," +
                "'" + ITestTemplateMethod.SUPPLIER + "'" +
                ")";
        return sql + values;
    }
}
